Similarity learning is a type machine learning task in artificial intelligence. The goal of similarity learning or metric learning is to learn, from examples, a function that measures how similar or related two objects are. For example, a distance function over objects may be learned by finding appropriate similarity measurements between pairs of instances that preserve a desired distance structure. In other words, similarity learning is a supervised method to learn a similarity measure between examples based on their class information. Similarity learning can be applied, for example, to ranking and recommendation systems. However, with the ever-growing database size and the trend to use high-dimensional image descriptors, traditional similarity learning algorithms have become impractical to compute because of the temporal and spatial complexity resulting from the high dimensions.